[libc++] Cleanup and document <__threading_support> Summary: This patch attempts to clean up the macro configuration mess in `<__threading_support>`, specifically the mess involving external threading variants. Additionally this patch adds design documentation for `<__threading_support>` and the configuration macros it uses. The primary change in this patch is separating the idea of an "external API" provided by `<__external_threading>` and the idea of having an external threading library. Now `_LIBCPP_HAS_THREAD_API_EXTERNAL` means that libc++ should use `<__external_threading>` and that the header is expected to exist. Additionally the new macro `_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL` is now used to configure for using an "external library" with the default threading API. Reviewers: compnerd, rmaprath Subscribers: smeenai, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D28316 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291275 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__config b/include/__config index ffd37c1..962ada5 100644 --- a/include/__config +++ b/include/__config
@@ -891,9 +891,7 @@ #endif // Thread API -#if !defined(_LIBCPP_HAS_NO_THREADS) && \ - !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \ - !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) +#if !defined(_LIBCPP_HAS_NO_THREADS) # if defined(__FreeBSD__) || \ defined(__Fuchsia__) || \ defined(__NetBSD__) || \ @@ -901,7 +899,9 @@ defined(__APPLE__) || \ defined(__CloudABI__) || \ defined(__sun__) -# define _LIBCPP_HAS_THREAD_API_PTHREAD +# ifndef _LIBCPP_HAS_THREAD_API_PTHREAD +# define _LIBCPP_HAS_THREAD_API_PTHREAD +# endif # else # error "No thread API" # endif // _LIBCPP_HAS_THREAD_API